package com.yupi.yupicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupicturebackend.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.yupi.yupicturebackend.api.aliyunai.model.CreateOutTextCreatePictureTaskRequest;
import com.yupi.yupicturebackend.api.aliyunai.model.CreateOutTextCreatePictureTaskResponse;
import com.yupi.yupicturebackend.model.entity.Picture;
import com.yupi.yupicturebackend.model.entity.User;
import com.yupi.yupicturebackend.model.req.picture.*;
import com.yupi.yupicturebackend.model.vo.PictureVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 86178
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-03-31 19:57:17
*/
public interface PictureService extends IService<Picture> {
    /**
     * 上传图片
     * @param inputSource
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);

    /**
     * 获取查询对象
     * @param pictureQueryRequest
     * @return
     */

   QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);


    /**
     * 获取图片VO
     * @param picture
     * @param request
     * @return
     */
   PictureVO getPictureVO(Picture picture, HttpServletRequest request);


    /**
     * 分页获取图片封装
     * @param picturePage
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    /**
     * 校验图片
     * @param picture
     */
    void validPicture(Picture picture);


    /**
     * 图片审核
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest,User loginUser);

    /**
     * 填充审核参数
     * @param picture
     * @param loginUser
     */
    void fillReviewParams(Picture picture, User loginUser);


    /**
     * 删除图片文件
     * @param oldPicture
     */
    void clearPictureFile(Picture oldPicture);


    /**
     * 批量上传图片
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return
     */
    Integer UpLoadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest,User loginUser);


    /**
     * 校验图片权限
     * @param picture
     * @param loginUser
     */
    void checkPictureAuth(Picture picture,User loginUser);

    /**
     * 删除图片
     * @param id
     * @param loginUser
     */
    void deletePicture(Long id, User loginUser);

    /**
     * 按照颜色搜索图片
     * @param spaceId
     * @param picColor
     * @param loginUser
     * @return
     */
    List<PictureVO> searchPictureByColor(Long spaceId, String picColor,User loginUser);


    /**
     * 批量编辑图片
     * @param pictureEditByBatchRequest
     * @param loginUser
     */
    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

 /**
  * 创建扩图任务
  * @param createPictureOutPaintingTaskRequest
  * @param loginUser
  * @return
  */
 CreateOutPaintingTaskResponse createOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);



  /**
  * 创建文字生成图片任务
  * @param createTextCreatePictureTaskRequest
  * @param loginUser
  * @return
  */
 CreateOutTextCreatePictureTaskResponse createTextCreatePictureTask(CreateTextCreatePictureTaskRequest createTextCreatePictureTaskRequest, User loginUser);

}


